package es.udc.emarketapp.emarket.model.purchase.purchaseFacade.actions;

import java.sql.Connection;

import es.udc.emarketapp.emarket.model.orderDetails.dao.SQLOrderDetailsDAO;
import es.udc.emarketapp.emarket.model.orderDetails.dao.SQLOrderDetailsDAOFactory;
import es.udc.emarketapp.emarket.model.orderDetails.vo.OrderDetailsVO;
import es.udc.fbellas.j2ee.util.exceptions.InstanceNotFoundException;
import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import es.udc.fbellas.j2ee.util.sql.TransactionalPlainAction;


public class ModifyOrderAction implements TransactionalPlainAction {

    private OrderDetailsVO orderVO;
    
    public ModifyOrderAction(OrderDetailsVO orderVO) {
        this.orderVO = orderVO;
    }
    
    public Object execute(Connection connection) 
        throws InternalErrorException, InstanceNotFoundException {        

        SQLOrderDetailsDAO orderDAO = SQLOrderDetailsDAOFactory.getDAO();

        orderDAO.update(connection, orderVO);  
        
        return null;

    }


}

